package graph_viewer.drawer;

import java.awt.*;

import graph_viewer.structure.Node;
import graph_viewer.structure.Node_Position;
import graph_viewer.structure.Visual_Component;

import graph_viewer.util.Debug;

/**
	Define method to draw a node, the drawing is done by Node_Drawer_Handler in subclasses.
*/
public class Leaf_Cluster_Node_Drawer extends Basic_Node_Drawer{
	boolean has_label, has_DOI;

	public Leaf_Cluster_Node_Drawer(){
		set_has_DOI( false );
		set_has_label( true );
	}

	public Leaf_Cluster_Node_Drawer( boolean has_label, boolean has_DOI ){
		set_has_DOI( has_DOI );
		set_has_label( has_label );
	}

	public Leaf_Cluster_Node_Drawer( boolean has_label ){
		set_has_DOI( false );
		set_has_label( has_label );
	}

	public void set_has_DOI( boolean has ){
		has_DOI		= has;
	}

	public void set_has_label( boolean has ){
		has_label	= has;
	}

	public boolean get_has_DOI(  ){
		return has_DOI;
	}

	public boolean get_has_label(  ){
		return has_label;
	}

	
	//abstract protected void draw_node(Node_Drawer_Handler ndh, Node node, Graphics2D g );
	protected void draw_node( Node node, Graphics2D g, int k ){
		Node_Position	np = node.get_position();
		//g.setStroke( new BasicStroke( 2 ) );

		int[] location 	= np.find_location();		
		
		g.setColor( LEAF_CLUSTER_COLOR );
		g.fillRect( location[0], location[1], np.get_width(), np.get_height() );

		g.setColor( Color.black );
		g.drawRect( location[0], location[1], np.get_width(), np.get_height() );		
	}
	

	protected void draw_DOI( Node node, final Graphics2D g){	}
}